package org.example.service;

import io.seata.rm.tcc.api.BusinessActionContext;
import io.seata.rm.tcc.api.BusinessActionContextParameter;
import io.seata.rm.tcc.api.LocalTCC;
import io.seata.rm.tcc.api.TwoPhaseBusinessAction;

@LocalTCC
public interface IStudentTccAction {
    @TwoPhaseBusinessAction(name = "studentAction", commitMethod = "commit", rollbackMethod = "rollback")
    boolean prepare(BusinessActionContext businessActionContext,
                    @BusinessActionContextParameter(paramName = "studentId") int id,
                    @BusinessActionContextParameter(paramName = "changescore") int changescore);

    boolean commit(BusinessActionContext businessActionContext);

    boolean rollback(BusinessActionContext businessActionContext);
}
